let baseUrl="https://api.it120.cc/small4/"
function request(params){
  wx.showLoading({
    title: '加载中',
  })
  //展示loading
  return new Promise((resolve,reject)=>{
    wx.request({
      ...params,
      url:baseUrl+params.url,
      success(res){
        resolve(res)

      },
      fail(err){
        reject(err)
      },
      complete(){
        wx.hideLoading()
        //隐藏loading
      }
    })

  })
}

export default request